export default class SingletonMgr {
    private static instances: Map<new (...args: any[]) => any, any> = new Map();

    static getInst<T>(ctor: new (...args: any[]) => T, ...args: any[]): T {
        if (!this.instances.has(ctor)) {
            this.instances.set(ctor, new ctor(...args));
        }
        return this.instances.get(ctor) as T;
    }
}